Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@websdk/rhumb
Advanced tools
routing, this and that.
Rhumb allows you to map paths to functions
rhumb.add("/happy/shoes", function(){
return shoes
})
If those paths contain variable parts, rhumb will grab them for you
rhumb.add("/happy/shoes/{color}", function(params){
return shoes.inColor(params.color)
})
Whatever you return in the callback will to handed back to the caller of match
redShoes = rhumb.match("/happy/shoes/red")
Fixed paths are the most simple
rhumb.add("/latest/potatoes")
will match /latest/potatoes
only
Use variable parts in your path to allow a range of options
rhumb.add("/potatoes/{variety}")
This route will match when anything is provided as a variety e.g.
A variety must be provided, so /potatoes
alone will not match
Paths with variable parts generate a params
object which is passed to the callback
rhumb.add("/potatoes/{variety}", function(params){
console.log(params.variety)
})
rhumb.match("/potatoes/marabel")
// > "marabel"
Partially variable parts allow you to capture more than one variable from a single segment of a URL.
If you wanted to capture a date in a url like /news-from/tue-march-1900
you could do so using partial parts.
rhumb.add("/news-from/{day}-{month}-{year}", function(params){
console.log(
params.day
, params.month
, params.year
)
})
Optional parts, well, are optional
rhumb.add("/stories(/{name})")
The above route matches for /stories
and for /stories/anything
Optionals can be nested e.g.
rhumb.add("/stories(/{author}(/{genre}))")
Will match
/stories
/stories/bob
/stories/sarah/scary
Have fun!
FAQs
URL routing in js
The npm package @websdk/rhumb receives a total of 0 weekly downloads. As such, @websdk/rhumb popularity was classified as not popular.
We found that @websdk/rhumb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.